package com.test.file;

import java.io.File;
import java.util.Arrays;

public class RenameFileTool {

    public static void main(String[] args) {
        String path = "D:\\资料\\美国绘画透视完全教程";
        File dir = new File(path);

        File[] files = dir.listFiles();

        Arrays.stream(files).filter(file -> file.getName().length() > 7).forEach(file -> {
            String oldName = file.getName();
            String newName = oldName.substring(1, oldName.length());
            file.renameTo(new File(file.getParent() + "/" + newName));
        });



    }
}
